Tests framework structure
Where to find mobile commands
- When look at commands in page files, e.g. setMobileElValue() may look new to you. Those mobile commands are defined in ./node_modules/testarmada-nightwatch-extra/lib/commands/mobile.
- Assertions, e.g. mobileElAttrContains(), are defined in ./node_modules/testarmada-nightwatch-extra/lib/assertions/mobile.
- To use those mobile commands and assertions, need to add the following lines in nightwatch.json file:
"custom_commands_path": [
"./node_modules/testarmada-nightwatch-extra/lib/commands/mobile"
],
"custom_assertions_path": [
"./node_modules/testarmada-nightwatch-extra/lib/assertions/mobile"
],
- You can also add your customized commands into folder ./lib/custom_commands, to increase code reusability. And please remember to add the path to nightwatch.json file, e.g.
"custom_commands_path": [
"./node_modules/testarmada-nightwatch-extra/lib/commands/mobile",
"./lib/custom_commands"
],